package table

import (
	"time"
)

// OrderTracking order_tracking 加工序跟踪表(一级表)
type OrderTracking struct {
	ID                int32
	State             int
	IDUserResponsible int // 责任人

	DateCreate   time.Time
	IDUserCreate int32
	DateMotify   time.Time
	IDUserMotify int32

	Priority int // 优先级

	DateTargetComplete time.Time // 目标完成时间
	DateActualComplete time.Time // 实际完成时间
}

// OrderPrimary order_primary 订单表(二级表)
type OrderPrimary struct {
	ID                int32
	IDUserResponsible int
	IDOrderTracking   int // order_tracking 的数据库 ID

	DateCreate   time.Time
	IDUserCreate int32
	DateMotify   time.Time
	IDUserMotify int32

	NumSAP            string // SAP 码
	Description       string // 名称/图号
	Count             int    // 订单数量
	IDMaterialPrimary int32  // material_primary 物料 ID

	DateTargetComplete time.Time
	DateActualComplete time.Time
}

// OrderSecondary order_secondary 详细工序(三级表)
type OrderSecondary struct {
	ID                int32
	State             int // 状态 -- 0:未执行 1:执行中 2:已完成 3:已关闭 4:被锁定
	IDUserResponsible int32
	IDOrderPrimary    int32

	DateCreate   time.Time
	IDUserCreate int32
	DateMotify   time.Time
	IDUserMotify int32

	IDProcessDrawing   int32  // process_drawing 工艺图纸 ID
	DescriptionProcess string // 工序描述/细节
	Signature          string // 签名(?)

	DateTargetComplete time.Time
	DateActualComplete time.Time
}
